<template>
	<view class="container">
		<view class="title">{{Info.Title}}</view>
		<view class="info" v-if="Info.ID>0">
			<view class="line1">来自：{{Info.From}}</view>
			<view class="line2">{{Tools.ToTime(Info.CreateDate)}}</view>
			<view class="line3">阅读（{{Info.ClickCount}}）</view>
		</view>
		<view class="context"><mp-html :content="Info.Context" /></view>
	</view>
</template>

<script>
	export default {
		onShareAppMessage: function() {
			var UserID = uni.getStorageSync("UserID");
		    return {
		      title: this.Info.Title,
		      path: "pages/news/newsinfo?ParentID="+UserID+"&ID="+this.ID//这是一个路径
		    }
		},
		data() {
			return {
				ID:0,
				Info:{ID:0}
			};
		},
		onLoad(options) {
			this.ID=options.ID;
			this.Util.SetParam(options);
			this.Find_NewsInfo();
		},
		methods:{
			Find_NewsInfo(){
				var data = {};
				data.Act="Find_NewsInfo";
				data.ID=this.ID;
				this.Util.Loading("加载中...");
				this.Util.Post(data, json=>{
					this.Util.HideLoading();
					uni.stopPullDownRefresh();
					uni.hideNavigationBarLoading();
					this.Info = json.Data.Info;
				});
			}
		}
	}
</script>

<style lang="scss">
	page{background-color: #ffffff;}
	.container{width:100%; padding:30rpx;
		.title{width:100%; min-height:60rpx; line-height: 60rpx; text-align: center; font-size:46rpx;}
		.info{width:100%; height: 40rpx; margin-top:30rpx; display: flex; flex-direction: row; justify-content: space-between; font-size:30rpx; color:#a8a8a8;
			.line1{width:auto; line-height: 40rpx;}
			.line2{flex:1; line-height: 40rpx; text-align: center;}
			.line3{width:auto; line-height: 40rpx;}
		}
		.context{width:100%; padding-top:50rpx; font-size:34rpx; line-height: 46rpx;}
	}
</style>
